# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mlmmj
pkgver=1.4.5
pkgrel=0
pkgdesc="Mailing list managing made joyful"
url="http://mlmmj.org/"
arch="all"
license="MIT"
subpackages="$pkgname-doc"
install="$pkgname.pre-install"
pkgusers="mlmmj"
pkggroups="mlmmj"
source="https://codeberg.org/mlmmj/mlmmj/releases/download/RELEASE_${pkgver//./_}/mlmmj-$pkgver.tar.gz"
options="!check"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		"$(want_check || echo --disable-tests)"
	make
}

package() {
	make -j1 DESTDIR="$pkgdir" install
	install -d "$pkgdir"/usr/share/mlmmj/texts
	cp -r listtexts/* "$pkgdir"/usr/share/mlmmj/texts/
	install -o mlmmj -g mlmmj -d "$pkgdir"/var/spool/mlmmj
}

sha512sums="
b555328bb34e642598965ce086dfaf20ea2a5157976fa6263b7b4274fdc81eb1e8691f31808a7f978ca5a4486c7baee7bf20bf732097f46f19d71cca31d9c94b  mlmmj-1.4.5.tar.gz
"
